package com.zy.chapter5

/**
 * @author: zhaoyi
 * @create: 2020-04-27 22:14
 * @description: ${description}
 **/
class InnerOutClass(name: String) {

  out =>
  private val age = 10

  class Inner(innerName: String) {
    println(s" 外部类的name:${out.name}, 内部类的name:${innerName}")
    println(s"也可以这样访问外部类的成员 ${InnerOutClass.this.age}")
  }

  def join(name: String): Inner = {
    val inner = new Inner(name)
    inner
  }

}
